﻿@{

    Layout = null;
}

@* 参考网址： https://layuion.com/  *@
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">

    <title>苦糖果MES</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="//unpkg.com/layui@2.9.16/dist/css/layui.css" rel="stylesheet">
    <link rel="shortcut icon" href="/images/logo.fb587223.png" type="image/x-icon">
    <link rel="icon" href="/images/logo.fb587223.png" type="image/x-icon">
</head>
<body>
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">

            <div class="layui-logo layui-hide-xs layui-bg-black"><a href="/home/show"> <img src="/images/logo.fb587223.png" alt="logo" width="30px" height="30px"></a><a href="/home/show" style="color: rgb(255, 255, 255);">&nbsp;苦糖果MES</a> </div>
            <!-- 头部区域（可配合layui 已有的水平导航） -->

            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="javascript:;">
                        <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                        牛夫人
                    </a>

                </li>
                <li class="layui-nav-item"><a href="/">退出</a></li>
            </ul>
        </div>
        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree" lay-filter="test">

                    <li class="layui-nav-item">
                        @*  <a href="javascript:;">首页</a> *@
                <dd><a class="site-active" tab-name="首页" tab-url="" tab-layid="0-1">首页</a></dd>
                </li>
                    @* 主数据 *@
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">主数据</a>
                    <dl class="layui-nav-child" style="cursor: pointer;">
                        <dd><a class="site-active" tab-name="物料产品管理" tab-url="/Maindata/MaterialProduct" tab-layid="1-1">物料产品管理</a></dd>
                        <dd><a class="site-active" tab-name="物料产品分类" tab-url="/maindata/materialproducttype" tab-layid="1-2">物料产品分类</a></dd>
                        <dd><a class="site-active" tab-name="计量单位" tab-url="/mainData/measuringUnit" tab-layid="1-3">计量单位</a></dd>
                        <dd><a class="site-active" tab-name="客户管理" tab-url="/MainData/CustomerManagement" tab-layid="1-4">客户管理</a></dd>
                        <dd><a class="site-active" tab-name="供应商管理" tab-url="/MainData/SupplierManagement" tab-layid="1-5">供应商管理</a></dd>
                        <dd><a class="site-active" tab-name="车间管理" tab-url="/maindata/shopfloor" tab-layid="1-6">车间管理</a></dd>
                        <dd><a class="site-active" tab-name="工作站" tab-url="/MainData/WorkStation" tab-layid="1-7">工作站</a></dd>
                    </dl>
                </li>
                    @* 仓储管理 *@
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">仓储管理</a>
                    <dl class="layui-nav-child" style="cursor: pointer;">
                        <dd><a class="site-active" tab-name="仓库设置" tab-url="/Zhou/WarehouseSetup" tab-layid="2-1">仓库设置</a></dd>
                        <dd><a class="site-active" tab-name="库存现有量" tab-url="/Meng/StockView" tab-layid="2-2">库存现有量</a></dd>
                        <dd><a class="site-active" tab-name="采购入库" tab-url="/warehouse/purchase" tab-layid="2-3">采购入库</a></dd>
                        <dd><a class="site-active" tab-name="供应商退货" tab-url="/Li/ReturnOrder" tab-layid="2-4">供应商退货</a></dd>
                        <dd><a class="site-active" tab-name="生产领料" tab-url="" tab-layid="2-5">生产领料</a></dd>
                        <dd><a class="site-active" tab-name="生产退料" tab-url="/Meng/OutSourceView" tab-layid="2-6">生产退料</a></dd>
                        <dd><a class="site-active" tab-name="产品入库" tab-url="/warehouse/productstorage" tab-layid="2-7">产品入库</a></dd>
                        <dd><a class="site-active" tab-name="销售退货" tab-url="" tab-layid="2-8">销售退货</a></dd>
                        <dd><a class="site-active" tab-name="转移调拨" tab-url="/Meng/WmTransferView" tab-layid="2-9">转移调拨</a></dd>
                        <dd><a class="site-active" tab-name="赋码管理" tab-url="/warehouse/codemanagement" tab-layid="2-10">赋码管理</a></dd>
                        <dd><a class="site-active" tab-name="装箱管理" tab-url="" tab-layid="2-11">装箱管理</a></dd>
                        <dd><a class="site-active" tab-name="SN码" tab-url="" tab-layid="2-12">SN码</a></dd>
                        <dd><a class="site-active" tab-name="库存盘点" tab-url="" tab-layid="2-13">库存盘点</a></dd>
                        <dd><a class="site-active" tab-name="外协发料" tab-url="/Meng/WmOutSorsceView" tab-layid="2-14">外协发料</a></dd>
                        <dd><a class="site-active" tab-name="外协入库" tab-url="/song/outsourced" tab-layid="2-15">外协入库</a></dd>
                    </dl>
                </li>

                    @* 设备管理 *@
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">设备管理</a>
                    <dl class="layui-nav-child" style="cursor: pointer;">
                        <dd><a class="site-active" tab-name="设备类型设置" tab-url="/Li/DV_Machinery_Type" tab-layid="3-1">设备类型设置</a></dd>
                        <dd><a class="site-active" tab-name="设备台账" tab-url="" tab-layid="3-2">设备台账</a></dd>
                        <dd><a class="site-active" tab-name="点检保养项目" tab-url="/Meng/DvCheckSubjectView" tab-layid="3-3">点检保养项目</a></dd>
                        <dd><a class="site-active" tab-name="点检保养计划" tab-url="/song/InspectionPlan" tab-layid="3-4">点检保养计划</a></dd>
                        <dd><a class="site-active" tab-name="维修单" tab-url="" tab-layid="3-5">维修单</a></dd>
                    </dl>
                </li>

                    @* 工装夹具管理 *@
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">工装夹具管理</a>
                    <dl class="layui-nav-child" style="cursor: pointer;">
                        <dd><a class="site-active" tab-name="类型设置" tab-url="/Zhou/ToolTypeSetting" tab-layid="4-1">类型设置</a></dd>
                        <dd><a class="site-active" tab-name="工装夹具台账" tab-url="" tab-layid="4-2">工装夹具台账</a></dd>
                    </dl>
                </li>

                    @* 生产管理 *@
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">生产管理</a>
                    <dl class="layui-nav-child" style="cursor: pointer;">
                        <dd><a class="site-active" tab-name="生产工单" tab-url="/song/productionOrder" tab-layid="5-1">生产工单</a></dd>
                        <dd><a class="site-active" tab-name="工序设置" tab-url="" tab-layid="5-2">工序设置</a></dd>
                        <dd><a class="site-active" tab-name="工艺流称" tab-url="" tab-layid="5-3">工艺流称</a></dd>
                        <dd><a class="site-active" tab-name="生产排产" tab-url="" tab-layid="5-4">生产排产</a></dd>
                        <dd><a class="site-active" tab-name="生产报工" tab-url="" tab-layid="5-5">生产报工</a></dd>
                    </dl>
                </li>

                    @* 质量管理 *@
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">质量管理</a>
                    <dl class="layui-nav-child" style="cursor: pointer;">
                        <dd><a class="site-active" tab-name="常见缺陷" tab-url="" tab-layid="6-1">常见缺陷</a></dd>
                        <dd><a class="site-active" tab-name="检测项设置" tab-url="" tab-layid="6-2">检测项设置</a></dd>
                        <dd><a class="site-active" tab-name="检测模版" tab-url="" tab-layid="6-3">检测模版</a></dd>
                        <dd><a class="site-active" tab-name="待检任务" tab-url="" tab-layid="6-4">待检任务</a></dd>
                        <dd><a class="site-active" tab-name="来料检验" tab-url="" tab-layid="6-5">来料检验</a></dd>
                        <dd><a class="site-active" tab-name="过程检验" tab-url="" tab-layid="6-6">过程检验</a></dd>
                        <dd><a class="site-active" tab-name="出货检验" tab-url="" tab-layid="6-7">出货检验</a></dd>

                    </dl>
                </li>
                    @* 排班管理 *@
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">排班管理</a>
                    <dl class="layui-nav-child" style="cursor: pointer;">
                        <dd><a class="site-active" tab-name="班组设置" tab-url="" tab-layid="7-1">班组设置</a></dd>
                        <dd><a class="site-active" tab-name="排班计划" tab-url="" tab-layid="7-2">排班计划</a></dd>
                        <dd><a class="site-active" tab-name="节假日设置" tab-url="" tab-layid="7-3">节假日设置</a></dd>
                        <dd><a class="site-active" tab-name="排版日历" tab-url="" tab-layid="7-4">排版日历</a></dd>
                    </dl>
                </li>

                </ul>
            </div>
        </div>

        <div class="layui-body">
            <!-- 内容主体区域 tab简单风格 class= layui-tab-brief -->
            <div class="layui-tab " lay-allowClose="true" lay-filter="tabList">
                <ul class="layui-tab-title">
                </ul>
                <div class="layui-tab-content">
                </div>
            </div>

        </div>

    </div>
    @*  <script src="~/Scripts/jquery-3.4.1.min.js"></script> *@
    @*<script src="~/Scripts/layui-v2.5.6/layui/lay/modules/leftmenu.js"></script>*@
    @*     <script src="~/Scripts/layui-v2.5.6/layui/layui.js"></script> *@
    <script src="//unpkg.com/layui@2.9.16/dist/layui.js"></script> *
    <script>
        //JavaScript代码区域
        layui.use(['element', 'jquery'], function () {
            var element = layui.element,
                $ = layui.jquery;

            //触发事件
            var active = {
                tabAdd: function (name, url, layid) {
                    if (url != "" && url != null && url != undefined) {
                        element.tabAdd('tabList', {
                            title: name //'选项卡的标题'
                            , content: '<iframe id="iframeMain" style="width: 100%" ; height="100%" ; scrolling="no" frameborder="no" src="' + url + '"></iframe>'//'选项卡的内容' //支持传入html
                            , id: layid//'选项卡标题的lay-id属性值'
                        });
                    }
                },
                tabChange: function (layid) {
                    element.tabChange('tabList', layid);
                }
            }

            //当点击有siteactive属性的标签时，即左侧菜单栏中内容 ，触发点击事件
            $('.site-active').on("click", function () {
                var dataid = $(this);
                var name = $(this).attr("tab-name");
                var url = $(this).attr("tab-url");
                var tab_layid = $(this).attr("tab-layid");

                //1、 判断tab-layid=layid的tab页是否打开
                if ($(".layui-tab-title li").length <= 0) {
                    //1.1 初始状态：1个Tab页也没有打开
                    active.tabAdd(name, url, tab_layid); //添加tab页
                    active.tabChange(tab_layid)//转到该tab页
                }
                else {
                    //1.2   判断该Tab页是否已打开
                    var isData = false; //初始化一个标志，为false说明未打开该tab项 为true则说明已有
                    $.each($(".layui-tab-title li"), function () {
                        //如果点击左侧菜单栏所传入的id 在右侧tab项中的lay-id属性可以找到，则说明该tab项已经打开
                        if ($(this).attr("lay-id") == tab_layid) {
                            isData = true;
                        }
                    })
                    if (isData == false) {
                        //标志为false 新增一个tab项
                        active.tabAdd(name, url, tab_layid); //1.2.1  该Tab页未打开，则打开该tab页
                    }
                    active.tabChange(tab_layid)//1.2.2 转到该tab页
                }
                FrameWH();  //计算ifram层的大小
            });

            function FrameWH() { //计算ifram层的大小
                var h = $(window).height();
                $("iframe").css("height", h + "px");

            }

            $(window).resize(function () {
                FrameWH();
            })

            $(function () {
                active.tabAdd('首页', "/Main/Student", 1); //打开tab页
                active.tabChange(1)//转到该tab页
                FrameWH();
            })
        });
    </script>
</body>
</html>